// Copyright 2004-2007 Castle Project - http://www.castleproject.org/
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
//     http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// MODIFICATIONS HAVE BEEN MADE TO THIS FILE
// COMDIV:
//  1. dependency MvcContrib dropped (imported namespaces)

using System.Collections;
using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Routing;
using Boo.Lang.Extensions;
//using Microsoft.Web.Mvc;
using MvcContrib.Comdiv.Extensibility.BooLang;

namespace MvcContrib.Comdiv.ViewEngines.Brail{
    public class BooViewEngineOptions{
        private readonly IList assembliesToReference = new ArrayList();
        private readonly IList namespacesToImport = new ArrayList();
        private IList<IBrailPreprocessor> _preprocessors = new List<IBrailPreprocessor>();
        private bool _saveBooResult = true;
        private string _saveBooResultDirectory = "tmp";
        private string baseType = "MvcContrib.Comdiv.ViewEngines.Brail.BrailBase";
        private string commonScriptsDirectory = "CommonScripts";
        private string saveDirectory = "Brail_Generated_Code";


        public BooViewEngineOptions(){
            AssembliesToReference.Add(typeof (BooViewEngineOptions).Assembly); //Brail's assembly
            AssembliesToReference.Add(typeof (Controller).Assembly); //MVC Framework's assembly
            AssembliesToReference.Add(typeof (AssertMacro).Assembly); //Boo.Lang.Extensions assembly
           // AssembliesToReference.Add(typeof (ViewExtensions).Assembly); //Microsoft.Mvc
            AssembliesToReference.Add(typeof (RouteValueDictionary).Assembly); //Microsoft.Mvc
            AssembliesToReference.Add(typeof (IncludeastMacro).Assembly);
            AssembliesToReference.Add(typeof(System.Linq.Enumerable).Assembly);
            NamespacesToImport.Add("System");
            NamespacesToImport.Add("MvcContrib.Comdiv.ViewEngines.Brail");
            NamespacesToImport.Add("System.Web.Mvc");
            namespacesToImport.Add("System.Web.Mvc.Html.LinkExtensions");
            NamespacesToImport.Add("System.Web.Routing");
            namespacesToImport.Add("System.Web.Mvc.Html");
            namespacesToImport.Add("MvcContrib.Comdiv.Extensibility");
            namespacesToImport.Add("MvcContrib.Comdiv.Extensibility.BooLang");
            namespacesToImport.Add("System.Collections.Generic");
            //namespacesToImport.Add("Microsoft.Web.Mvc");
            //namespacesToImport.Add("Microsoft.Web.Mvc.ViewExtensions");
            namespacesToImport.Add("System.Linq");
            namespacesToImport.Add("System.Linq.Enumerable");
        }

       
        public bool Debug { get; set; }

        public bool SaveToDisk { get; set; }

        public bool BatchCompile { get; set; }

        public string CommonScriptsDirectory{
            get { return commonScriptsDirectory; }
            set { commonScriptsDirectory = value; }
        }

        public string SaveDirectory{
            get { return saveDirectory; }
            set { saveDirectory = value; }
        }

        public IList AssembliesToReference{
            get { return assembliesToReference; }
        }

        public IList NamespacesToImport{
            get { return namespacesToImport; }
        }

        public string BaseType{
            get { return baseType; }
            set { baseType = value; }
        }


        public bool SaveBooResult{
            get { return _saveBooResult; }
            set { _saveBooResult = value; }
        }


        public string SaveBooResultDirectory{
            get { return _saveBooResultDirectory; }
            set { _saveBooResultDirectory = value; }
        }
    }
}